Implement multiple file exclusion sets#7836
Conversation
|
@RaymondLim just letting you know I'm going to make some tweaks to this PR now. |
…p and bottom padding that makes the visual form better.
|
@RaymondLim visual tweaks done. |
|
Thanks @larz0. I forgot to commit the svg file and you just submitted with your visual tweaking. |
…ring after closing the Edit Filter dialog.
…the negative margin of the bottom of File Count message.
…after the removed item in the dropdown list.
Add a new set of unit tests for testing preferences and view states used for multiple file filter sets.
|
To me |
|
@RaymondLim Just starting to look at this. A couple of issues I noticed:
|
|
(/cc @larz0 to consider some of the UI issues mentioned in the comment above) |
There was a problem hiding this comment.
This could just be return _.findIndex(filterSets, function (curFilter) { return _.isEqual(filter, curFilter); });
Or, slightly fancier, this might work: return _.findIndex(filterSets, _.partial(_.isEqual, filter));
|
@njx I addressed most of your feedback with the following exceptions.
Fixed.
Fixed.
Fixed, an existing bug that you can also reproduce in CSS New Rule button.
Partially fixed by not closing Find bar, but was unable to restore focus to the Search text field. |
|
The UI changes look good, but a couple of notes:
This is problematic, since we assume the Find bar is closed whenever focus is outside it. If you get into this case, then hitting Esc won't close the Find bar, for example. It's probably worth figuring out how to set focus back into the input field. (Eventually we want to change this so the find bar can stay open when focus is in the document...we wouldn't have to fix anything for Find in Files specifically, I think, but we would have to make some changes for that to work for single-file Find/Replace, and we wouldn't want the two to behave inconsistently with each other.) One other very minor note...the positioning of the "x" looks wrong on hover - it's slightly off-center relative to the checkmark. Maybe have @larz0 take a look. I'll take a look at the code itself now. |
There was a problem hiding this comment.
I don't think we have to deal with this now, but at the point where we want to reuse this UI in multiple places I think we should convert this from a singleton module to a class. (Even if we don't ever happen to show more than one picker at once, it seems cleaner to encapsulate the state in a class, so we know that two instances won't accidentally cross-talk with each other.)
|
Re-reviewed. My general comment would be to be careful about overly-general jQuery selectors - make sure you're looking specifically for the item you know you're looking for - and also to encapsulate UI knowledge where possible, rather than having clients know about the internal UI implementation of the component they're using. |
|
@njx Ready for re-review. |
|
Hmmm, I just realized a UI issue with the checkmark. Because it's a checkmark, you might think that selecting the same item again would toggle it off. (That's especially true if there's only one item. It might not be immediately obvious that the way you uncheck it is to select "Don't Exclude Files".) I don't think that needs to prevent us merging this now, but we might want @larz0 to try it out and see how it feels. Should be a small bugfix if we want to implement that (and/or take the checkmark back out, though I think it's better to keep it in). |
|
Changes look good. Just my one comment about the "refresh" event. |
|
@njx I think it's fine because the control is a selector and not a menu item of a menu. |
…irectly in refresh().
|
@njx. I find a way to move the triggerHandler call into _renderList as you suggested, so ready for the final review (I think). |
|
@RaymondLim Changes look good. I just had the one comment about documenting the event - once you've added that comment, feel free to go ahead and merge. |
|
(Oops, that comment was on the commit, not the PR) |
Implement multiple file exclusion sets
No description provided.